<template>
  <div class="mv-item" @click="handleMvItemClick(mvItem.vid)">
    <div class="mv-img" :style="{backgroundImage:'url('+mvItem.coverUrl+'?param=120y70'+  ')'}"></div>
    <div class="mv-desc">
      <h4 class="mv-tit">{{mvItem.title}}</h4>
      <div class="mv-art">
        <span>{{mvItem.durationms | setTime}}</span>,
        by
        <span v-for="(subitem,j) in mvItem.creator" :key="j">{{subitem.userName}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import {
  filterSetPlayCount,
  filterSetTime,
  filterSetYear
} from "@/utils/filters";
export default {
  props: {
    mvItem: {
      type: Object,
      default: {}
    }
  },
  filters: {
    setTime: function(value) {
      return filterSetTime(value);
    }
  },
  methods: {
    handleMvItemClick(id) {
      this.$emit("clickedItem", id);
    }
  }
};
</script>

<style lang="less" scoped>
.mv-item {
  .flex-row-nowrap(flex-start);
  margin-bottom: 12px;
  .mv-img {
    display: block;
    width: 120px;
    height: 70px;
    border-radius: 0.1rem;
    overflow: hidden;
    background-color: #fff;
    flex: 0 0 120px;
    .bz(cover);
  }
  .mv-desc {
    flex: 1;
    padding: 0 12px;
    overflow: hidden;
    .mv-tit {
      font-size: 16px;
      line-height: 20px;
      max-height: 40px;
      overflow: hidden;
      .cf;
    }
    .mv-art {
      .flex-row-nowrap(center);
      font-size: 14px;
      color: #999;
      margin-top: 8px;
      .sl;
    }
  }
}
</style>